﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Aspire
{
    public class AspireException :Exception
    {
        // 摘要:
        //     Initializes a new instance of the System.Exception class.
        public AspireException(ExceptionType exceptionType)
            : base()
        {
            TypeID = exceptionType;
        }
        //
        // 摘要:
        //     Initializes a new instance of the System.Exception class with a specified
        //     error message.
        //
        // 参数:
        //   message:
        //     The message that describes the error.
        public AspireException(ExceptionType exceptionType, string message)
            : base(message)
        {
            TypeID = exceptionType;
        }
        //
        // 摘要:
        //     Initializes a new instance of the System.Exception class with a specified
        //     error message and a reference to the inner exception that is the cause of
        //     this exception.
        //
        // 参数:
        //   message:
        //     The error message that explains the reason for the exception.
        //
        //   innerException:
        //     The exception that is the cause of the current exception, or a null reference
        //     (Nothing in Visual Basic) if no inner exception is specified.
        public AspireException(ExceptionType exceptionType, string message, Exception innerException)
            : base(message, innerException)
        {
            TypeID = exceptionType;

        }
        /// <summary>
        /// 异常的类型信息
        /// </summary>
        public ExceptionType TypeID { get; set; }

        /// <summary>
        /// 异常详情
        /// </summary>
        public string Message { get; set; }

    }

    public enum ExceptionType
    {
        /// <summary>
        /// 框架初始化错误
        /// </summary>
        FRAMEWORK_INIT_ERROR,
        /// <summary>
        /// 配置文件错误
        /// </summary>
        CONFIG_FILE_ERROR,

    }
}
